

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using JTC.MiniCommerce.Core;
using JTC.MiniCommerce.Store;

namespace JTC.MiniCommerce.Web.controls {
  public partial class categoryNavigation : System.Web.UI.UserControl {

    #region Page Events

    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, EventArgs e) {
      try {
        LoadCategories();
      }
      catch (Exception ex) {
        Logger.Error(typeof(categoryNavigation).Name + "Page_Load", ex);
      }
    }

    #endregion

    #region Methods

    #region Private

    /// <summary>
    /// Loads the categories.
    /// </summary>
    private void LoadCategories() {
      DataSet ds = new CategoryController().FetchCategoryList();
      xmlDataSource.EnableCaching = false;
      xmlDataSource.Data = ds.GetXml();
    }

    #endregion

    #endregion

  }
}